home *** CD-ROM | disk | FTP | other *** search
/ Palm Utilities / Palm_Utilities_CD-ROM_2001_2001.iso / files / pim / Hot Date 1.3e / hotdate.exe / hotdate / todo.h < prev   
Encoding:
C/C++ Source or Header  |  1999-07-07  |  3.2 KB  |  115 lines

  1. /* $Id: todo.h,v 1.4 1999/07/07 01:48:34 chrisf Exp $ */
  2.  
  3. /*
  4. Hot Date - A DatebookDB displayer for the PalmPilot
  5. Copyright (C) 1999 Chris Faherty
  6.  
  7. This program is free software; you can redistribute it and/or
  8. modify it under the terms of the GNU General Public License
  9. as published by the Free Software Foundation; either version 2
  10. of the License, or (at your option) any later version.
  11.  
  12. This program is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. GNU General Public License for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with this program; if not, write to the Free Software
  19. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20. */
  21.  
  22. #ifndef __TODO_H__
  23. #define __TODO_H__
  24.  
  25. #include <DateTime.h>
  26.  
  27. #define LocalizedAppInfoStr 1000
  28.  
  29. #define todoLabelLength 12
  30. #define todoNumFields 16
  31.  
  32. #define toDoMaxPriority 5
  33.  
  34. /* Dirty flags for to do application info */
  35. #define toDoSortByPriorityDirty    0x0001
  36.  
  37. /* Sort orders */
  38. #define soDueDatePriority 0
  39. #define soPriorityDueDate 1
  40. #define soCategoryPriority 2
  41. #define soCategoryDueDate 3
  42.  
  43. typedef struct {
  44.     UInt renamedCategories; /* bitfield of categories with a different name */
  45.     char categoryLabels[dmRecNumCategories][dmCategoryLength];
  46.     Byte categoryUniqIDs[dmRecNumCategories];
  47.     Byte lastUniqID;    /* Uniq IDs generated by the device are between */
  48.                         /* 0 - 127.  Those from the PC are 128 - 255. */
  49.     Byte reserved1;     /* from the compiler word aligning things */
  50.     Word reserved2;
  51.     UInt dirtyAppInfo;
  52.     Byte sortOrder;
  53. } ToDoAppInfoType;
  54.  
  55. typedef ToDoAppInfoType * ToDoAppInfoPtr;
  56.  
  57. /*
  58.  * ToDoDBRecord.
  59.  *
  60.  * All strings are null terminated and appear within the record.
  61.  */
  62. typedef struct {
  63.     DateType dueDate;
  64.     unsigned char priority; /* high bit is complete flag */
  65.     char description;
  66. } ToDoDBRecord;
  67.  
  68. typedef ToDoDBRecord * ToDoDBRecordPtr;
  69.  
  70. /*
  71.  * sizeDBRecord is the minimum size for the ToDoDBRecord structure.
  72.  * It assumes empty 'description' and 'note' fields.
  73.  * sizeDBRecord allocates an extra byte for the null character
  74.  * for the note string.
  75.  */
  76. #define sizeDBRecord (sizeof(ToDoDBRecord) + 1)
  77.  
  78. /*
  79.  * ToDoItemType
  80.  *
  81.  * This is the format of a to do record used by the application.  All 
  82.  * pointers are either NULL or point to data within the PackedDB record.
  83.  * All strings are null character terminated.
  84.  */
  85. typedef struct {
  86.     DateType dueDate;
  87.     unsigned char priority; /* high bit is complete flag */
  88.     CharPtr description;
  89.     CharPtr note;
  90. } ToDoItemType;
  91.  
  92. typedef ToDoItemType * ToDoItemPtr;
  93.  
  94. #define completeFlag 0x80
  95. #define priorityOnly ~completeFlag
  96. #define toDoNoDueDate 0xffff
  97.  
  98. /* Used for ToDoChangeRecord. */
  99. typedef enum  { 
  100.     toDoPriority,
  101.     toDoComplete,
  102.     toDoDueDate,
  103.     toDoDescription,
  104.     toDoNote,
  105.     toDoCategory } ToDoRecordFieldType;
  106.  
  107. /*
  108.  * Function prototypes
  109.  */
  110. UInt GetToDo(DmOpenRef dbP, DateType date, Word days, VoidHand apptLists [],
  111.     UInt counts []);
  112. void SelectCategoryPopup(DmOpenRef dbP, TablePtr table, Word row);
  113.  
  114. #endif __TODO_H__
  115.